package handler

import (
	v1 "cat-collage-backend/internal/controllor/v1"
	"cat-collage-backend/internal/middleware"
	"github.com/gin-gonic/gin"
	"gorm.io/gorm"
	"net/http"
)

// SetupRoutes 设置应用的路由
func SetupRoutes(router *gin.Engine, db *gorm.DB) {
	// 健康检查路由
	router.GET("/health", func(c *gin.Context) {
		c.String(http.StatusOK, "OK")
	})

	setupV1RouterGroups := router.Group("v1")
	setupAuthV1RouterGroups := setupV1RouterGroups.Group("a")
	setupAuthV1RouterGroups.Use(middleware.AuthMiddleware(db))
	v1.SetupV1Group(setupAuthV1RouterGroups, setupV1RouterGroups, db)

	// TODO: 在这里添加其他路由和处理函数
}
